<?php

class Date{
	
	var $year;
	var $month;
	var $day;
	var $hour;
	var $minutes;
	var $seconds;
	var $micoseconds;
	var $gmttime;
	
	function Date($string=''){
			
	}

	function setYear($year=NULL){
		if(is_null($year)) $year =date("Y");
		$this->year = $year;
		return true;
	}
	
	function setMonth($month=NULL){
		if(is_null($month)) $month =date("m");
		if($month<1 && $month>12){
			return false;
		}
			$this->month = $month;
			return true;
	}
	
	function setDay($day=NULL){
		if(is_null($day)) $day =date("d");
		if($day < 1 || $day > 31) return false;
		if(is_null($this->month) || is_null($this->year)){
			$this->day = $day;
		}else{
		
		}
		return true;
	
	}
	
	function setHour($hour=NULL){
		if(is_null($hour)) $hour = date("H");
		if($hour<0 || $hour >23) return false;
		$this->hour = $hour;
		return true;
	}
	
	function setMintues($mintues=NULL){
		if(is_null($mintues)) $mintues = date("i");
		if($mintues<0 || $mintues >59) return false;
		$this->mintues = $mintues;
		return true;
	}
	
	function setSeconds($seconds=NULL){
		if(is_null($seconds)) $seconds = date("s");
		if($seconds<0 || $seconds >59) return false;
		$this->seconds = $seconds;
		return true;
	}
	
	function setGMTTime($gmttime=NULL){
		
	}
	
	function getYear(){
		return $this->year;
	}
	
	function getMonth(){
		return $this->month;	
	}
	
	function getDay(){
		return $this->day;
	}
	
	
	
	function setGMTTime($time=0){
		$this->gmttime = $time;
	}
	
	function getCustomString($string='Y-m-d H:i:s'){
		
	}
	
	function getFullString(){
		return $this->getCustomString('Y-m-d H:i:s G');
	}
	
	function getDateTimeString(){
		return $this->getCustomString('Y-m-d H:i:s');
	}
	
	function getDateString(){
		return $this->getCustomString('Y-m-d');
	}
	
	function getTimeString(){
		return $this->getCustomString('H:i:s');
	}
	
	function __toString(){
		return $this->getFullString();
	}
}

?>